"This method generates an INI file containing values to be used with NSIS installer."

| header stream temp |
header := {
	'PRODUCT' -> {
		'NAME' -> 'Squeak'.
		'VERSION' -> (Smalltalk version copyFrom: 7 to: (Smalltalk version size)).
		'PUBLISHER' -> 'Squeak Community'.
		'WEBSITE' -> 'http://www.squeak.org'.
	}.
	'CONSTANT' -> {
		'IMAGE_FILE' -> (FileDirectory localNameFor: (Smalltalk imageName)).
		'IMAGE_VERSION' -> (SystemVersion current highestUpdate).
		'SOURCE_FILE' -> (FileDirectory localNameFor: (Smalltalk sourcesName)).
		'CHANGES_FILE' -> (FileDirectory localNameFor: (Smalltalk changesName)).
		'VM_FILE' -> (temp := (FileDirectory localNameFor: (Smalltalk getSystemAttribute: 0))).
		'INI_FILE' -> ((temp copyFrom: 1 to: (temp size) - 4), '.ini').
		'VM_VERSION' -> '4.0.2'.		"FIXME: Smalltalk vmVersion returns 3.10.2?!!"
	}
}.

stream := FileStream forceNewFileNamed: 'Definitions.nsh'.
stream nextPutAll: '# Automatically generated from Squeak using GenerateInstallerDefinitions.st.'; crlf; crlf.

header do: [:section |
	Transcript show: section key; cr.
	"stream nextPutAll: ('[', section key, ']'); crlf."
	
	section value do: [:item |
		Transcript tab; show: (item key asString), ': ', (item value asString); cr.
		stream nextPutAll: 
			('!!define ', (section key), '_', (item key asString), ' "', (item value asString), '"'); crlf.
	].

	stream crlf.
].

stream close.

SmalltalkImage current snapshot: false andQuit: true.